<?php

class AboutUsController extends AppController {

    var $name = 'AboutUs';
    var $uses = array();

    function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allowedActions = array('*');
    }

    function index($id=null) {
        $this->layout = "cms";
        $this->loadModel('Category');
        $this->set('item', $this->Category->categoryArray());
        $this->loadModel('Cmspage');
        $this->set('cmspages', $this->Cmspage->find('all', array('conditions' =>
                    array('Cmspage.listed_under' => 'About Us', 'Cmspage.status' => 'Enabled'), 'order' => 'Cmspage.id ASC'
                )));

        if ($id != null) {
            $this->set('cmspage_dtls', $this->Cmspage->find('all', array('conditions' =>
                        array('Cmspage.listed_under' => 'About Us', 'Cmspage.status' => 'Enabled', 'Cmspage.id' => $id)
                    )));
        } else {
            $this->set('cmspage_dtls', $this->Cmspage->find('all', array('conditions' =>
                        array('Cmspage.listed_under' => 'About Us', 'Cmspage.status' => 'Enabled'), 'order' => 'Cmspage.id ASC', 'limit' => 1
                    )));
        }
    }

    function faqs() {
        $this->layout = "cms";
        $this->layout = "cms";
        $this->loadModel('Category');
        $this->set('item', $this->Category->categoryArray());
        $this->loadModel('Cmspage');
        $this->set('cmspages', $this->Cmspage->find('all', array('conditions' =>
                    array('Cmspage.listed_under' => 'About Us', 'Cmspage.status' => 'Enabled'), 'order' => 'Cmspage.id ASC'
                )));
    }

}

?>